# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-fuzzyfinder
pkgname=('python2-fuzzyfinder' 'python-fuzzyfinder')
_pkgname=fuzzyfinder
pkgver=2.3.0
pkgrel=1
pkgdesc='Fuzzy Finder implemented in Python.'
arch=('any')
url='https://pypi.org/project/fuzzyfinder/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('8f42923de0f622b2e6fa07e24e4181948b78013311d02f8772e5e4ae71c071f3595384ae9f225859ca54137622cbec8de30f068f0459553085a36ccb2680f64d')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-fuzzyfinder() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-fuzzyfinder() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

